package com.common.www.repository.programme;

import org.springframework.boot.base.jpa.repository.support.ExtendedRepository;
import com.common.www.bean.entity.programme.XfgcPrecipitate;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Repository
public interface XfgcPrecipitateRepository extends ExtendedRepository<XfgcPrecipitate, Long> {

    /**
     * 按项目删除
     * @param flag
     * @param projectId
     * @return
     */
    @Modifying
    @Transactional
    int deleteByFlagAndProjectId(Integer flag,Long projectId);

    /**
     * 按当前项目查询
     * @param flag
     * @param projectId
     * @return
     */
    List<XfgcPrecipitate> findByFlagAndProjectId(Integer flag,Long projectId);

    /**
     * 按项目和供应商查询历史信息
     * @param flag
     * @param projectId
     * @param supplyCompanyId
     * @return
     */
    List<XfgcPrecipitate> findByFlagAndProjectIdAndSupplyCompanyId(Integer flag,Long projectId,Long supplyCompanyId);
}
